package cn.fafu.fafu_record.service;

import cn.fafu.fafu_record.entity.Image;
import cn.fafu.fafu_record.mapper.ImageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class ImageService {

    @Autowired
    ImageMapper imageMapper;

    @Async
    public boolean addImage(Image image){
        try {
            imageMapper.save(image);
            return true;
        }catch (Exception e){
            return false;
        }

    }

}
